<?php

namespace App\ModelFilters;

use EloquentFilter\ModelFilter;

class StoreFilter extends ModelFilter
{
    /**
    * Related Models that have ModelFilters as well as the method on the ModelFilter
    * As [relationMethod => [input_key1, input_key2]].
    *
    * @var array
    */
    public $relations = [];

    /**
     * 按管理ID搜索.
     *
     * @param $aids
     * @return StoreFilter
     */
    public function aids($aids)
    {
        return $this->whereIn('aid', $aids);
    }

    /**
     * 按管理ID搜索.
     *
     * @param $aid
     * @return StoreFilter
     */
    public function aid($aid)
    {
        return $this->where('aid', $aid);
    }

    /**
     * 按商店名称搜索.
     *
     * @param $name
     * @return StoreFilter
     */
    public function name($name)
    {
        return $this->where('name', $name);
    }

    /**
     * 按状态搜索.
     *
     * @param $status
     * @return StoreFilter
     */
    public function status($status)
    {
        return $this->where('status', $status);
    }
}
